<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>text _diary</title>
    <link rel="stylesheet" href="../../css/base.css">
    <link rel="stylesheet" href="../../css/fy/text _diary.css">
</head>

<body>
    <div class="wrap">

        <!-- 头 -->
        <div class="parcel">
            <header>
                <div class="concent">
                    <div class="logo">
                        <a class="sub_log" href="/">胶囊日记</a>
                    </div>
                    <ul class="nav">
                        <li>
                            <a href="../ys/index.html">首页</a>
                        </li>
                        <li>
                            <a href="../zy/guanzhugeren1.html">关注</a>
                        </li>
                        <li>
                            <a href="/">话题</a>
                        </li>
                        <li>
                            <a href="/"><span>App</span>下载</a>
                        </li>
                    </ul>
                </div>

                <div class="sub_nav">

                    <div class="see write_diary">
                        <a class="writeDiary" href="./text _diary.html">写日记</a>
                        <div class="color"></div>
                    </div>

                    <div class="set alert">
                        <a href="/">提醒(0)<span>▼</span></a>
                        <div class="alert_matter">
                            <div class="matter"></div>
                            <div class="sub_matter">
                                <span>没有提醒</span>
                            </div>
                        </div>

                    </div>


                    <div class="set auto">
                        <div class="userName">
                            <span class="mingzi"></span>
                            ▼
                        </div>

                        <div class="auto_sort">
                            <div class="sort"></div>
                            <div class="sub_sort">
                                <a href="/">我的日记</a>
                                <a href="/">我关注的人</a>
                                <a href="./set_message.html">设置</a>
                                <a href="/">退出</a>
                            </div>
                        </div>
                    </div>

                </div>


            </header>
        </div>
        <div class="top"></div>

        <!-- 主体 -->
        <div class="main">
            <!-- 个人信息 导航 -->
            <ul class="message">
                <li>
                    文本日记
                </li>
                <li>
                    <a href="../../html/fy/typeid.html"> 照片日记</a>
                </li>
            </ul>

            <!-- 内容更改 -->
            <div class="sub_main">
                <ul class="diary_left">
                    <li class="diary_name">
                        <select id="group" value="1">
                            <option value="1">你哈</option>
                            <option value="2">哈哈哈</option>
                        </select>
                    </li>
                    <li>
                        <div class="hint">日记长度至少要 24 个字</div>
                    </li>
                    <li class="sub_up">

                        <div class="box">
                            <textarea name="" id="text" cols="30" rows="10"></textarea>
                            <div class="box1">
                                <input type="checkbox" id="point" />
                                <span>重要日记 (?)</span>
                            </div>
                        </div>
                    </li>
                    <li class="choose">
                        <button class="save">发布日记</button>
                    </li>
                </ul>
                <div class="diary_right">
                    <!-- <div class="time">
                        <span>09/14</span>
                        <div class="sub_time">
                            <span>星期三</span>
                            <span>/2022</span>
                        </div>
                    </div>
                    <a class="sub_save" href="../../html/fy/set_diario.html">创建新日记本</a> -->

                </div>
            </div>
        </div>

        <!-- 底 -->
        <div class="sole">
            <footer>
                <ul class="about_us">
                    <li>
                        <p>© 2009－2022</p>
                        <a class="timep" href="/">timepill.net</a>
                        <span>|</span>
                    </li>
                    <li>
                        <a href="/">沪ICP备18006482号-1</a>
                        <span>|</span>
                    </li>
                    <li>
                        <a href="/">常见问题</a>
                        <span>|</span>
                    </li>
                    <li>
                        <a href="/">捐助胶囊</a>
                        <span>|</span>
                    </li>
                    <li>
                        <p class="about">联系我们:mx1700@gmail.com</p>
                    </li>
                </ul>


                <ul class="rendered">
                    <li>
                        <a href="/">图片存储由又拍云存储提供</a>
                        <span>|</span>
                    </li>
                    <li>
                        <p>rendered in 0.0034 s</p>
                    </li>
                </ul>
            </footer>

        </div>
    </div>
</body>

<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="../../js/requestPre.js"></script>
<script src="../../js/fy/ajax.js"></script>
<script>

    let hintEl = document.querySelector('.hint')
    let saveEl = document.querySelector('.save')
    let textEl = document.querySelector('#text')

    // 文本框点击事件
    saveEl.onclick = function () {

        if (textEl.value.length < 24) {
            hintEl.style.display = 'block';
        } else {
            hintEl.style.display = 'none';
            location.href = '../lk/user-diary.html'
        }
<<<<<<< HEAD
    }

    let user = localStorage.user && JSON.parse(localStorage.user)
    // console.log(user);

    //   用户名获取
    let mingZi = document.querySelector('.mingzi')
    headUserName()
    async function headUserName() {

        let res = await axios({
            method: 'GET',
            url: '/api/user',
            params: {
                userId: user.userId,
            }
        })
        let html = ''
        html += `
                ${res.data.data.username} 
            `
        mingZi.innerHTML = html
=======
>>>>>>> 096bacc8c8ec486a8690e4749be02e8a4d1777c8
    }


    // 右边时间
    let diaryRight = document.querySelector('.diary_right')
    diaryRight.innerHTML = ` 

                        <div class="time">
                            <span>${dateBirth()}</span>
                            <div class="sub_time">
                                <span>${getDate()}</span>
                                <span>/${time()}</span>
                            </div>
                        </div>
                        <a class="sub_save" href="../../html/fy/set_diario.html">创建新日记本</a>
 
        `


    // 年
    function time() {
        let date = new Date()
        let year = date.getFullYear()
        return `${year}`
    }

    // 月 日 
    function dateBirth() {
        let date = new Date()
        let year = date.getFullYear()
        let month = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
        let day = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate())

        return `${month}/${day}`
    }
    // 周
    function getDate() {
        let now = new Date();
        let w = "星期" + "日一二三四五六".charAt(now.getDay());
        return (w);
    }

</script>

</html>